<?
class LangAdminBO extends BusinessObject{

  /* private function using in constructors*/ 
  function setAttributes(){
  	$this->fields	= array(
  		'id'		=> 'langID',
  		'name'		=> 'langName',
  		'short_name'	=> 'langShort',
		'visible'		=> 'langVisible',
	        'admin_name'	=> 'langAdminName',
        	'trivalent'	=> 'langTrivalent');
        
    BusinessObject::setAttributes();
  }
  /* constructor */
  function LangAdminBO(){
    /** super(tableName) */
    BusinessObject::BusinessObject("lang_admin");
    $this->setAttributes();
  }

  // function 'get_lang_as_html' return the tag(s) OPTION with lang's names and ids
  function get_lang_as_html($selected_langID){
	$lang = new LangAdminBO();
	$ret = "";
	$lang->Load(0,0,array($lang->fields['name']=>0));
	while ($lang->Next()) {
	  $ret.= "<option value='{$lang->id}' ".(($selected_langID==$lang->id)?"selected":"").">".htmlspecialchars($lang->name)."</option>";
	}
	return $ret;
  }

}
?>
